<?php
/*
 * $advpolls = array(
 *  0 => object('title' => 'xx'),
 *  1 => object('title' => 'xx'),
 *  ...
 * );
*/
?>
<?php foreach($advpolls as $poll):?>
<ul class="vote-ul">
  <li>
    <div class="vote-item">
        <div class="vote-item-title"><h5><?php echo l($poll->title, "node/$poll->nid", array('query' => 'destination=' . $_GET['q']));?></h5></div>
        <div class="vote-item-footer">
          <span class="vote-count"><?php echo format_plural($poll->num, '1 vote', '@count votes');?></span>
          <?php if ($poll->active):?>
          <span class="vote-status-open"><?php echo t('open');?></span>
          <?php else:?>
          <span class="vote-status-closed"><?php echo t('closed');?></span>
          <?php endif;?>
        </div>
    </div>
  </li>
</ul>
<?php endforeach;?>

<?php echo theme("pager", NULL, 15);?>

<?php if (!$advpolls):?>
  <ul class="vote-ul">
    <li>
      <div class="vote-item" >
          <div class="vote-item-no-data"><?php echo t('No Polls');?></div>
          <div class="vote-item-footer"></div>
      </div>
    </li>
  </ul>
<?php endif;?>
